import os

from openai import OpenAI

api_key = os.getenv("OPENAI_API_KEY")
client = OpenAI(
  api_key=api_key
)

def get_completion(prompt, model="gpt-4.1-mini"):
    messages = [{"role": "user", "content": prompt}]
    response = client.chat.completions.create(
        model=model,
        messages=messages,
        temperature=0, # this is the degree of randomness of the model's output
    )
    return response.choices[0].message.content




##
completion = get_completion("你好")
#  model="gpt-4o-mini",
 # store=True,
 # messages=[
 #   {"role": "user", "content": "你好"}
 # ]
#)
##

print(completion)
